﻿using Dora.Tools.Enums.AdminUser;
using Dora.Tools.Utility;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dora.Services.AdminUser.Dto.ViewDto
{
    public class TasUserBriefListDto
    {
        #region model

        /// <summary>
        /// 
        /// </summary>
        public Guid Id { get; set; }
                
        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { get; set; }


        /// <summary>
        /// Email
        /// </summary>
        public string Email { get; set; }


        /// <summary>
        /// 真实姓名
        /// </summary>
        public string RealName { get; set; }

        /// <summary>
        /// 性别;0未知1男2女
        /// </summary>
        public int Sex { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string Avatar { get; set; }

        /// <summary>
        /// 环信用户名
        /// </summary>
        public string HxUserName { get; set; }

        /// <summary>
        /// 工号
        /// </summary>
        public string JobNumber { get; set; }

        /// <summary>        /// 用户所属OrgId        /// </summary>        public int OrgId { get; set; }

        /// <summary>        /// 用户所属OrgName        /// </summary>        public string OrgName { get; set; }
        #endregion
        #region Extend

        /// <summary>
        /// 该门店距离当前位置的距离（单位:米）
        /// </summary>
        public decimal Distance { get; set; }

        /// <summary>
        /// 是否主负责人
        /// </summary>
        public int IsLeader { get; set; }

        /// <summary>
        /// 该门店距离当前位置的人性化距离
        /// </summary>
        public string DistanceText
        {
            get
            {
                if (Distance > 0 && Distance < 1000)
                {
                    return $"{Distance}米";
                }
                else if (Distance >= 1000 && Distance < 100 * 1000)
                {
                    return $"{(Distance / 1000).ToString("F1")}千米";
                }
                else
                {
                    return $">100千米";
                }
            }
        }
        #endregion
    }
}
